Repository navigation
feat: oss index categories endpoint - #2351
Conversation
PR SummaryLow Risk Overview The handler loads the group from
Tests cover the new route (pipes, mapping, 400/404/503, OpenAPI) and unit tests for the category tuple guard and mapper. Reviewed by Cursor Bugbot for commit 3b61d7c. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation matches the described contract and includes comprehensive validation and test coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Adds the /v1-alpha/oss-index/categories endpoint for retrieving a category group and its categories.
Changes:
- Adds validated Tinybird queries and response schemas.
- Adds 8-slot project tuple mapping.
- Adds comprehensive endpoint and mapper tests.
| File | Description |
|---|---|
api/src/versions/v1-alpha/oss-index/categories.ts |
Implements the endpoint. |
api/src/lib/oss-index.ts |
Adds category project guards, schema, and mapper. |
api/tests/oss-index-categories.test.ts |
Tests endpoint behavior and validation. |
api/tests/oss-index.test.ts |
Tests tuple mapping and guards. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
gaspergrom
left a comment
There was a problem hiding this comment.
Looks good to me. The 8-slot guard composes cleanly into the 9-slot one, and the tests cover the 404 short-circuit and the malformed-row 503 paths.
|
@cursor review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit bb8e59d. Configure here.
Signed-off-by: anilb <epipav@gmail.com>
Signed-off-by: anilb <epipav@gmail.com>
Signed-off-by: anilb <epipav@gmail.com>
Signed-off-by: anilb <epipav@gmail.com>
Signed-off-by: anilb <epipav@gmail.com>


Summary
Adds
GET /v1-alpha/oss-index/categories(IN-1415, epic IN-1146). It returns one category group's details and its categories, each with its top collections and top projects.categoryGroupSlugpicks the group and is required.sort(totalContributorsorsoftwareValue, defaulttotalContributors) orders the categories.category_groups_listfirst. An unknown slug answers 404not_found, and the categories pipe is then skipped.categories_oss_index, with tuples mapped through the shared module from the groups endpoint.upstream_unavailable.Notes
status, sosrc/lib/oss-index.tsgainsCategoryTopProjectand its guard and mapper. Both project guards share the leading slots and the v2 health tail. The groups route's shape is unchanged.{ name, slug, type, categories }, a single group with its child list.Tests
tests/oss-index-categories.test.ts: both pipe calls and their params, 404 for an unknown slug, 400 for a missing slug or an invalid sort, tuple mapping, 503 for malformed rows, empty categories, and the OpenAPI entry.tests/oss-index.test.ts: the 12-slot guard and mapper.main